#include "../common/common.h"


#ifndef __MEI_HEADER__
#define __MEI_HEADER__

class MotionEnegry
{
 public:
  MotionEnegry(const char * _videoFileName,const char * _featureFileName, int _col=10, int _row=10, int _meiLength=5) ; 
  ~MotionEnegry() ;
 private:
  void calculateFeature() ;
  void calculateSevenHuFeature(float *, float *) ;
  unsigned pushImage(CvCapture* _capture) ;
  void getDiffImage(IplImage*,IplImage*,IplImage*) ;
  int getMEI(float *);
  float calculateM(float* _featureBuf, int p, int q) ;
  float calculateU(float* _featureBuf, int p, int q, float _avgX, float _avgY) ;
 private:
  std::string videoFileName ;
  std::string featureFileName ;
  std::list<std::pair<int,IplImage*> > imageList ;
  IplImage* ansImage;
  IplImage* nowImage ;
  const int COL ;
  const int ROW ;
  const int MEILength ;
};

#endif 
